//
//  CTMainPointVC.m
//  digitalCurrency
//
//  Created by 默认账户 on 2019/6/1.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "CTMainPointVC.h"
#import "CEPointInsVC.h"
#import "CTReleasedVC.h"
#import "CTPerformanceVC.h"
#import "CTFinanceManageVC.h"
#import "CTQGListVC.h"
#import "CTTEListVC.h"

@interface CTMainPointVC ()
@property (nonatomic, copy) NSArray *titles;
@end

@implementation CTMainPointVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.viewTitle.text = LocalizationKey(@"Revenue record");
    
    _titles = @[LocalizationKey(@"理财收益"),LocalizationKey(@"挖矿收益"),LocalizationKey(@"节点收益"),LocalizationKey(@"分红收益")];
    
    [self.view addSubview:self.tableView];
    self.tableView.rowHeight = 50;
    self.tableView.frame     = CGRectMake(0, 0, SCREEN_WIDTH, 300);
    self.tableView.separatorColor = [UIColor clearColor];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"setcell"];
        
}
    

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return _titles.count;
}
    
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"setcell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType  = UITableViewCellAccessoryDisclosureIndicator;
        
        UIView *lineView = [[UIView alloc]init];
        [cell.contentView addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(15);
            make.right.equalTo(-15);
            make.bottom.equalTo(0);
            make.height.equalTo(0.5);
        }];
        lineView.backgroundColor = tTableViewCellLine;
       
        cell.textLabel.text = _titles[indexPath.row];
        cell.textLabel.textColor = tThreeColor;
        cell.textLabel.font = kFont(15);
        
        
        
        return cell;
    }
    
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    switch (indexPath.row) {
        case 0:
        {
            CEPointInsVC *sec = [[CEPointInsVC alloc] init];
            [self.navigationController pushViewController:sec animated:YES];
        }
            break;
        case 1:
        {
            CTQGListVC *sec = [[CTQGListVC alloc] init];
            [self.navigationController pushViewController:sec animated:YES];
        }
            break;
        case 2:
        {
            CTReleasedVC *sec = [[CTReleasedVC alloc] init];
            [self.navigationController pushViewController:sec animated:YES];
        }
            break;
        case 3:
        {
            CTTEListVC *sec = [[CTTEListVC alloc] init];
            [self.navigationController pushViewController:sec animated:YES];
        }
            break;
        case 4:
        {
            CTPerformanceVC *vc = [[CTPerformanceVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 5:
        {
            CTFinanceManageVC *vc = [[CTFinanceManageVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        default:
            break;
    }
}
    

@end
